namespace DataModels.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddExcelTemplateCellAssociations : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.ExcelTemplateCellAssociations",
                c => new
                    {
                        CellId_1 = c.Int(nullable: false),
                        CellId_2 = c.Int(nullable: false),
                        IsNumeric = c.Boolean(nullable: false),
                    })
                .PrimaryKey(t => new { t.CellId_1, t.CellId_2 })
                .ForeignKey("dbo.ExcelTemplateCells", t => t.CellId_1, cascadeDelete: false)
                .ForeignKey("dbo.ExcelTemplateCells", t => t.CellId_2, cascadeDelete: false)
                .Index(t => t.CellId_1)
                .Index(t => t.CellId_2);
            
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.ExcelTemplateCellAssociations", "CellId_2", "dbo.ExcelTemplateCells");
            DropForeignKey("dbo.ExcelTemplateCellAssociations", "CellId_1", "dbo.ExcelTemplateCells");
            DropIndex("dbo.ExcelTemplateCellAssociations", new[] { "CellId_2" });
            DropIndex("dbo.ExcelTemplateCellAssociations", new[] { "CellId_1" });
            DropTable("dbo.ExcelTemplateCellAssociations");
        }
    }
}
